package com.xge.common_libary.view

import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import android.widget.FrameLayout
import android.widget.ImageView
import androidx.constraintlayout.widget.ConstraintLayout
import com.xge.common_libary.databinding.CommonToolBarViewBinding

class CommonToolBarView @JvmOverloads constructor(
    context: Context,
    attrs: AttributeSet? = null,
    defStyleAttr: Int = 0
) : ConstraintLayout(context, attrs, defStyleAttr) {

    private var binding: CommonToolBarViewBinding

    init {
        val inflater = LayoutInflater.from(context)
        binding = CommonToolBarViewBinding.inflate(inflater, this, true)
    }

    fun setTitleByVal(title: String){
        binding.tvTitle.text = title
    }

    fun getBackByView(): ImageView {
        return binding.ivBack
    }
}